﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    CodeBehind="ServiceCall.aspx.cs" Inherits="VSM.ServiceCall" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        function isNumberKey(sender, evt) {
            var txt = sender.value;
            var dotcontainer = txt.split('.');
            var charCode = (evt.which) ? evt.which : event.keyCode;
            if (!(dotcontainer.length == 1 && charCode == 46) && charCode > 31 && (charCode < 48 || charCode > 57))
                return false;

            return true;
        }
        function OpenItemPopup() {
            var supplier = $("#<%= txtVendorCode.ClientID %>").val();

            var url = "../../ItemPopup.aspx?Supplier=" + supplier
            Main.openCustomDialog(url, 600, 610);
        }
        function OpenVendor() {

            var url = "../../VendorPopup.aspx";
            Main.openCustomDialog(url, 600, 610);
        }
    </script>
    <div>
        <asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:HiddenField ID="hdnIsUpdate" runat="server" />
                <asp:HiddenField ID="hdnStatus" runat="server" />
                <h2>
                    &nbsp;<asp:Label ID="lblTitle" runat="server" Text="Service Call"></asp:Label>
                </h2>
                <div style="margin-left: 5px; width: 99%;">
                    <hr />
                    <table border="0" width="100%" style="background-color: #D1D4D8; font-weight: bold;">
                        <tr>
                            <td>
                                Mfr Serial No:
                            </td>
                            <td>
                                <asp:TextBox ID="txtVendorName0" runat="server" Width="250px"></asp:TextBox>
                            </td>
                            <td style="width: 100px">
                                Service No:
                            </td>
                            <td align="left">
                                <asp:Label ID="lblStatus" runat="server" Text="0001"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Serial&nbsp; No:
                            </td>
                            <td>
                                <asp:TextBox ID="txtVendorName1" runat="server" Width="250px">S1-000055</asp:TextBox>
                            </td>
                            <td style="width: 100px">
                                Status:
                            </td>
                            <td align="left">
                                <asp:Label ID="Label2" runat="server" Text="Open"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 150px">
                                Created Date:
                            </td>
                            <td style="width: 250px">
                                <asp:TextBox ID="txtPODate" runat="server" AutoPostBack="True" OnTextChanged="txtPODate_TextChanged">02/18/2014</asp:TextBox>
                                <asp:ImageButton ID="Image1" runat="Server" AlternateText="Click to show calendar"
                                    ImageUrl="~/Images/Calendar_scheduleHS.png" />
                                <cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtPODate"
                                    PopupButtonID="Image1" Format="dd/MM/yyyy">
                                </cc1:CalendarExtender>
                            </td>
                            <td>
                                Priority:
                            </td>
                            <td>
                                <asp:DropDownList ID="ddl_Priority" runat="server">
                                    <asp:ListItem Value="0">Low</asp:ListItem>
                                    <asp:ListItem Value="1">Medium</asp:ListItem>
                                    <asp:ListItem Value="2">Hight</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td valign="middle">
                                Closed Date:
                            </td>
                            <td valign="top">
                                <asp:TextBox ID="txtDelDate" runat="server"></asp:TextBox>
                                <asp:ImageButton ID="ImageButton1" runat="Server" AlternateText="Click to show calendar"
                                    ImageUrl="~/Images/Calendar_scheduleHS.png" />
                                <cc1:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtDelDate"
                                    PopupButtonID="ImageButton1" Format="dd/MM/yyyy">
                                </cc1:CalendarExtender>
                            </td>
                            <td valign="middle" style="display: none">
                                <asp:CheckBox ID="chkUrgent" runat="server" Text="Urgent" />
                            </td>
                            <td style="display: none">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Posting Date:
                            </td>
                            <td>
                                <asp:TextBox ID="txtPostingDate" runat="server"></asp:TextBox>
                                <cc1:CalendarExtender ID="txtPostingDate_CalendarExtender" runat="server" Format="dd/MM/yyyy"
                                    PopupButtonID="ImageButton1" TargetControlID="txtPostingDate">
                                </cc1:CalendarExtender>
                                <asp:ImageButton ID="Image2" runat="Server" AlternateText="Click to show calendar"
                                    ImageUrl="~/Images/Calendar_scheduleHS.png" />
                            </td>
                            <td>
                                &nbsp;
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Customer:
                            </td>
                            <td colspan="2">
                                <cc1:CalendarExtender ID="CalendarExtender3" runat="server" Format="dd/MM/yyyy" PopupButtonID="ImageButton1"
                                    TargetControlID="txtPostingDate">
                                </cc1:CalendarExtender>
                                <asp:TextBox ID="txtVendorCode" runat="server" BackColor="#E6E6E6" ReadOnly="True"
                                    Width="96px">C60000</asp:TextBox>
                                <asp:TextBox ID="txtVendorName" runat="server" Width="250px">SG Electronics</asp:TextBox>
                                <asp:Button ID="btnSelectVendor0" runat="server" OnClientClick="OpenVendor(); return false;"
                                    Style="background-image: url('/Images/bgButton.png'); background-repeat: no-repeat;
                                    font-weight: bold" Text="..." />
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Contact Person:
                            </td>
                            <td>
                                <cc1:CalendarExtender ID="CalendarExtender4" runat="server" Format="dd/MM/yyyy" PopupButtonID="ImageButton1"
                                    TargetControlID="txtPostingDate">
                                </cc1:CalendarExtender>
                                <asp:TextBox ID="txtConpersonName" runat="server" Width="368px">Eric Alexander</asp:TextBox>
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Item:
                            </td>
                            <td colspan="2">
                                <asp:TextBox ID="txtVendorCode0" runat="server" BackColor="#E6E6E6" ReadOnly="True"
                                    Width="96px">S10000</asp:TextBox>
                                <asp:TextBox ID="txtVendorName3" runat="server" Width="250px">Server Point 10000</asp:TextBox>
                                <asp:Button ID="btnSelectVendor1" runat="server" OnClientClick="OpenVendor(); return false;"
                                    Style="background-image: url('/Images/bgButton.png'); background-repeat: no-repeat;
                                    font-weight: bold" Text="..." />
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Subject:
                            </td>
                            <td colspan="2">
                                <asp:TextBox ID="txtConpersonName0" runat="server" Width="100%">Call 00020</asp:TextBox>
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 24px">
                                Origin:
                            </td>
                            <td style="height: 24px">
                                <asp:DropDownList ID="DropDownList2" runat="server">
                                    <asp:ListItem Value="0">Telephone No.</asp:ListItem>
                                    <asp:ListItem Value="1">E-mail</asp:ListItem>
                                    <asp:ListItem Value="2">Web</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td style="height: 24px">
                                Call Type:
                            </td>
                            <td style="height: 24px">
                                <asp:DropDownList ID="DropDownList4" runat="server">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Problem Type:
                            </td>
                            <td>
                                <asp:DropDownList ID="DropDownList3" runat="server">
                                    <asp:ListItem Value="0">Engine</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td>
                                Technician:
                            </td>
                            <td>
                                <asp:DropDownList ID="DropDownList5" runat="server">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Handled by:
                            </td>
                            <td>
                                <asp:DropDownList ID="ddl_HandledBy" runat="server">
                                    <asp:ListItem Value="001">Jayson Butler</asp:ListItem>
                                    <asp:ListItem Value="002">John Peterson</asp:ListItem>
                                    <asp:ListItem Value="003">Jim Boswick</asp:ListItem>
                                    <asp:ListItem Value="004">Henry Vu</asp:ListItem>
                                    <asp:ListItem Value="005">Frank Truong</asp:ListItem>
                                    <asp:ListItem Value="006">Kevin Nguyen</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td>
                                Queue:
                            </td>
                            <td>
                                <asp:TextBox ID="txtQueue" Text="Bugi" runat="server" Width="250px"></asp:TextBox>
                                <asp:Button ID="btnSelectQueue" runat="server" Style="background-image: url('/Images/bgButton.png');
                                    background-repeat: no-repeat; font-weight: bold" Text="..." />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4">
                                <cc1:TabContainer ID="TabContainer1" runat="server" Width="100%" 
                                    ActiveTabIndex="0">
                                    <cc1:TabPanel ID="tabActivities" runat="server">
                                        <HeaderTemplate>
                                            Activities</HeaderTemplate>
                                        <ContentTemplate>
                                            <asp:GridView ID="grvAct" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
                                                BackColor="White" BorderColor="White" CellPadding="2" CellSpacing="2" CssClass="GridInner"
                                                OnPageIndexChanging="grvSearchResult_PageIndexChanging" OnRowCancelingEdit="CancelEdit"
                                                OnRowCreated="grvPO_RowCreated" OnRowDataBound="grvSearchResult_RowDataBound"
                                                OnRowDeleting="DeleteItem" OnRowEditing="EditItem" OnRowUpdating="UpdateItem"
                                                PageSize="20" Width="100%">
                                                <AlternatingRowStyle BackColor="#EEF1F7" BorderColor="White" BorderWidth="2px" />
                                                <Columns>
                                                    <asp:TemplateField HeaderText="Action">
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="lnkDelete" runat="server" OnClick="lnkDelete_Click" TabIndex="-1"
                                                                Text="Delete"></asp:LinkButton>
                                                        </ItemTemplate>
                                                        <HeaderStyle VerticalAlign="Middle" />
                                                        <ItemStyle HorizontalAlign="Center" Width="20px" />
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="#">
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblNo" runat="server" BorderStyle="none" Text="">
                                                            </asp:Label>
                                                        </ItemTemplate>
                                                        <HeaderStyle VerticalAlign="Middle" />
                                                        <ItemStyle HorizontalAlign="Center" Width="20px" />
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Date">
                                                        <ItemTemplate>
                                                            <asp:TextBox ID="lblDate" runat="server" Text='<%# Bind("Date") %>'></asp:TextBox>
                                                        </ItemTemplate>
                                                        <HeaderStyle Font-Bold="True" VerticalAlign="Middle" />
                                                        <ItemStyle HorizontalAlign="Center" Width="100px" />
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Time">
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblTime" runat="server" BorderStyle="none" Text='<%# Bind("Time") %>' />
                                                        </ItemTemplate>
                                                        <HeaderStyle Font-Bold="True" VerticalAlign="Middle" />
                                                        <ItemStyle HorizontalAlign="Center" Width="50px" />
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Handled By">
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblHandledBy" runat="server" BorderStyle="none" Text='<%# Bind("HandledBy") %>' />
                                                        </ItemTemplate>
                                                        <HeaderStyle Font-Bold="True" VerticalAlign="Middle" />
                                                        <ItemStyle HorizontalAlign="Left" Width="150px" />
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Activities Date">
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblActivitieDate" runat="server" BorderStyle="none" Text='<%# Bind("ActivitieDate") %>' />
                                                        </ItemTemplate>
                                                        <HeaderStyle VerticalAlign="Middle" Width="100px" />
                                                        <ItemStyle HorizontalAlign="Center" />
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Recurrence">
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblRecurrence" runat="server" BorderStyle="none" Text='<%# Bind("Recurrence") %>' />
                                                        </ItemTemplate>
                                                        <HeaderStyle VerticalAlign="Middle" />
                                                        <ItemStyle HorizontalAlign="Left" />
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Content">
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblContent" runat="server" BorderStyle="none" Text='<%# Eval("Content")%>' />
                                                        </ItemTemplate>
                                                        <HeaderStyle VerticalAlign="Middle" />
                                                        <ItemStyle HorizontalAlign="Left" />
                                                    </asp:TemplateField>
                                                </Columns>
                                                <EmptyDataTemplate>
                                                    <table border="1" cellpadding="2" cellspacing="2" class="GridInner" rules="all" style="width: 100%;
                                                        border-color: White;">
                                                        <tr style="height: 27px; color: white; font-weight: bold; text-decoration: none;
                                                            background-color: rgb(96, 149, 201);" valign="middle">
                                                            <th>
                                                                <span>Action</span>
                                                            </th>
                                                            <th>
                                                                <span>#</span>
                                                            </th>
                                                            <th>
                                                                <span>Date</span>
                                                            </th>
                                                            <th>
                                                                <span>Time</span>
                                                            </th>
                                                            <th>
                                                                <span>Handled By</span>
                                                            </th>
                                                            <th>
                                                                <span>Activities Date</span>
                                                            </th>
                                                            <th>
                                                                <span>Recurrence</span>
                                                            </th>
                                                            <th>
                                                                <span>Content</span>
                                                            </th>
                                                        </tr>
                                                        <tr>
                                                            <td colspan="8">
                                                                <span>No Data</span>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </EmptyDataTemplate>
                                                <HeaderStyle BackColor="#6095C9" Font-Bold="True" Font-Overline="False" ForeColor="White"
                                                    Height="27px" VerticalAlign="Bottom" />
                                                <PagerSettings Mode="NumericFirstLast" />
                                                <PagerStyle BackColor="#70A0D0" Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Middle" />
                                                <RowStyle BackColor="#D9E0ED" BorderColor="White" BorderWidth="2px" Height="25px" />
                                            </asp:GridView>
                                        </ContentTemplate>
                                    </cc1:TabPanel>
                                    <cc1:TabPanel ID="tabSolution" runat="server">
                                        <HeaderTemplate>
                                            Solutions</HeaderTemplate>
                                        <ContentTemplate>
                                            <asp:Button ID="Button1" runat="server" Text="Button" />
                                            <asp:CheckBoxList ID="CheckBoxList1" runat="server" BorderColor="DeepPink" ForeColor="Snow"
                                                BackColor="Crimson" BorderWidth="1" RepeatColumns="2" Width="500">
                                                <asp:ListItem>Crimson</asp:ListItem>
                                                <asp:ListItem>RosyBrown</asp:ListItem>
                                                <asp:ListItem>DodgerBlue</asp:ListItem>
                                                <asp:ListItem>Salmon</asp:ListItem>
                                                <asp:ListItem>DeepPink</asp:ListItem>
                                                <asp:ListItem>HotPink</asp:ListItem>
                                                <asp:ListItem>Violet</asp:ListItem>
                                            </asp:CheckBoxList>
                                        </ContentTemplate>
                                    </cc1:TabPanel>
                                    <cc1:TabPanel ID="tabExpense" runat="server">
                                        <HeaderTemplate>
                                            Expenses</HeaderTemplate>
                                        <ContentTemplate>
                                            <asp:Image ID="Image4" runat="server" />
                                        </ContentTemplate>
                                    </cc1:TabPanel>
                                    <cc1:TabPanel ID="tabHistory" runat="server">
                                        <HeaderTemplate>
                                            History</HeaderTemplate>
                                        <ContentTemplate>
                                            <asp:Image ID="Image5" runat="server" />
                                        </ContentTemplate>
                                    </cc1:TabPanel>
                                    <cc1:TabPanel ID="tabScheduling" runat="server">
                                        <HeaderTemplate>
                                            Scheduling</HeaderTemplate>
                                        <ContentTemplate>
                                            <asp:Image ID="Image6" runat="server" />
                                        </ContentTemplate>
                                    </cc1:TabPanel>
                                </cc1:TabContainer>
                            </td>
                        </tr>
                    </table>
                    <hr />
                </div>
                <table width="100%" border="0">
                    <tr>
                        <td colspan="2">
                            <table style="width: 100%">
                                <tr>
                                    <td style="width: 400px;">
                                        <asp:Button ID="btnSaveDraft" runat="server" Text="Save" Style="background-image: url('/Images/bgButton.png');
                                            background-repeat: no-repeat; color: White;" OnClick="btnSaveDraft_Click" BorderStyle="Solid" />
                                        <asp:Button ID="btnCancel" runat="server" Text="Cancel" Style="background-image: url('/Images/bgButton.png');
                                            background-repeat: no-repeat; color: White;" BorderStyle="Solid" OnClick="btnCancel_Click" />
                                    </td>
                                    <td>
                                        <asp:Label ID="lblError" runat="server" Visible="False" Font-Bold="True" ForeColor="Red"></asp:Label>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
